﻿#ifndef USERINFOWIDGET_H
#define USERINFOWIDGET_H

#include <QWidget>
#include <QGraphicsDropShadowEffect>
#include <QMouseEvent>
#include "MyPDU.h"

namespace Ui {
class UserInfoWidget;
}

class UserInfoWidget : public QWidget
{
    Q_OBJECT

public:
    explicit UserInfoWidget(QWidget *parent = nullptr);
    ~UserInfoWidget();
    void initInfo(const UserInfo& userInfo, bool isFriend);
    void setBtnHide();//当是自己时  隐藏按钮
    void setBtnText(const QString& text);
protected:
    void mousePressEvent(QMouseEvent *event);//鼠标点击
    void mouseMoveEvent(QMouseEvent *event);//鼠标移动
    void mouseReleaseEvent(QMouseEvent *event);//鼠标释放
    void setShadow();
private slots:
    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_clicked();

private:
    Ui::UserInfoWidget *ui;
    bool isPressedWidget;//isPressedWidget和last用来控制窗口移动
    QPoint last;
    UserInfo m_userInfo;
};

#endif // USERINFOWIDGET_H
